

package org.example.iris.service.impl;

import org.example.iris.mapper.InterviewScheduleMapper;
import org.example.iris.entity.InterviewSchedule;
import org.example.iris.service.InterviewScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InterviewScheduleServiceImpl implements InterviewScheduleService {

    @Autowired
    private InterviewScheduleMapper interviewScheduleMapper;

    @Override
    public int arrangeInterview(int studentId, int companyId, String date, String time, String location, String result) {
        return interviewScheduleMapper.insertInterviewSchedule(studentId, companyId, date, time, location, result);
    }

    @Override
    public List<InterviewSchedule> getStudentInterviewSchedules(int studentId) {
        return interviewScheduleMapper.getInterviewSchedulesByStudentId(studentId);
    }

    @Override
    public List<InterviewSchedule> getCompanyInterviewSchedules(int companyId) {
        return interviewScheduleMapper.getInterviewSchedulesByCompanyId(companyId);
    }

    @Override
    public int modifyInterviewResult(int interviewId, String result) {
        return interviewScheduleMapper.updateInterviewResult(interviewId, result);
    }

    @Override
    public int removeInterviewSchedule(int interviewId) {
        return interviewScheduleMapper.deleteInterviewSchedule(interviewId);
    }
}
